package com.example.demo.controller;

import org.springframework.web.bind.annotation.*;

@RestController
public class HelloController {

     @GetMapping("/hello")
  //  http://localhost:8080/hello?nickname =刘青
    public String hello(String nickname,String phone) {
        System.out.print(nickname);
        return "hello world!"+nickname;
    }

    @RequestMapping(value = "/hello_1",method = RequestMethod.GET)
    public String hello_1(@RequestParam(value = "nickname",required = false) String name){
         return "第二种方式"+name;
    }

    @GetMapping("/test/**")
    public String test() {
        return "通配符";
    }
}
